#!/usr/bin/env python
# -*- coding:utf-8 -*-

# file:homework3_7.py
# author:wmf
# datetime:2021/4/6 23:00
# software: PyCharm
'''
this is function description
'''
# import module your need

# 7 对一篇中文文献, ;
# 利用jieba库,进行词频统计分析找出文章的关键词
# (取词频最高的前10个词语,作为文章的关键字);

import os
import jieba

with open('KUNG I-GHI','r',encoding = 'utf-8') as f:
    words = jieba.lcut(f.read())

dict1 = {}
for word in words:
    if(word in dict1):
        dict1[word] = dict1[word] + 1
    else:
        dict1[word] = 1

list1 = sorted(dict1.items(),key = lambda items:items[1],reverse=True)

for i in range(0,10):
    print(list1[i],end=',')